<template>
  <div id="app">
    <router-view/>
    <theme-picker/>
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";

export default {
  name: "App",
  components: {ThemePicker},
  metaInfo() {
    return {
      title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
      titleTemplate: title => {
        return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
      }
    }
  },
  methods:{
    bodyScale() {
      const deviceWidth = document.body.clientWidth
      const deviceHeight = document.body.clientHeight
      const scaleW = deviceWidth / 1920
      const scaleH = deviceHeight / 1080
      document.getElementById('app-wrapper').style.zoom = scaleW > scaleH ? scaleH : scaleW
      // document.body.style.zoom = scaleW > scaleH ? scaleH : scaleW
    }
  },
  mounted() {
    // setTimeout(() => {
    //   this.bodyScale()
    // }, 500)
    // window.addEventListener('resize', () => {
    //   this.bodyScale()
    // })
  }
};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
